//
//  AppDelegate.m
//  QBLottery
//
//  Created by Wang Li on 14-1-11.
//  Copyright (c) 2014年 Wang Li. All rights reserved.
//

#import "AppDelegate.h"
#import "MyScene.h"



@implementation AppDelegate

@synthesize window = _window;

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
    self.window.delegate = self;
    /* Pick a size for the scene */
    SKScene *scene = [MyScene sceneWithSize:CGSizeMake(1024, 768)];

    /* Set the scale mode to scale to fit the window */
    scene.scaleMode = SKSceneScaleModeFill;

    SKTexture *backgroundTexture = [SKTexture textureWithImageNamed:@"lobg.png"];
    SKSpriteNode *background = [SKSpriteNode spriteNodeWithTexture:backgroundTexture size:CGSizeMake(MaxWidth, MaxHeight)];
    background.position = (CGPoint) {MaxWidth/2, MaxHeight/2};
    [scene addChild:background];
    
    [self.skView presentScene:scene];

    self.skView.showsFPS = YES;
    self.skView.showsNodeCount = YES;
    
}

- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender {
    return YES;
}



- (NSSize)windowWillResize:(NSWindow *)sender toSize:(NSSize)frameSize
{
    return frameSize;
}
@end
